<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    
<!DOCTYPE html>
<html>
<head>
<title>左下家居创意设计官网</title> ﻿
<meta charset="UTF-8">
<link rel="alternate icon" type="image/png" href="images/favicon.png">
<link rel='icon' href='favicon.ico' type='image/x-ico' />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="stylesheet" href="css/default.min.css?t=227" />
<link rel="stylesheet" href="admin/lib/layui/css/layui.css"
	type="text/css"></link>
<script type="text/javascript" src="admin/lib/layui/layui.js"></script>
<script type="text/javascript" src="lib/jquery/jquery.min.js"></script>
<script type="text/javascript" src="lib/handlebars/handlebars.min.js"></script>
<script type="text/javascript" src="lib/iscroll/iscroll-probe.js"></script>
<script type="text/javascript" src="lib/amazeui/amazeui.min.js"></script>
<script type="text/javascript" src="lib/raty/jquery.raty.js"></script>
<script type="text/javascript" src="js/main.min.js?t=1"></script>
</head>
<body>

<!--	<div id="head"></div>-->
<!--	<script type="text/javascript">-->
<!--		$('#head').load('head.html')-->
<!--	</script>-->

<!-- TODO 替换为head.html -->
<div class="header-top" >
	<div class="width-center">
		<div class="header-logo ">
			<img src="images/zuoxialogo.jpg" height="100px" width="100px">
		</div>
		<div class="header-title div-inline">
			<strong>左下家居</strong> <span>zuoxiajiaju</span>
		</div>
		<div class="search-box div-inline">
			<div class="input-box">
				<input type="text" name="" id="newT" value="" placeholder="请输入关键字">
			</div>
			<div class="search-botton" onclick=""></div>
		</div>
	</div>
</div>
<div class="header-nav">
	<button class="am-show-sm-only am-collapsed font f-btn"
			data-am-collapse="{target: '.header-nav'}">
		Menu <i class="am-icon-bars"></i>
	</button>
	<nav>
		<ul class="header-nav-ul am-collapse am-in">
			<li class="on"><a href="IndexServlet?reqName=toIndex" name="index">首页</a></li>
			<li><a href="AboutServlet?reqName=toAbout" name="about">关于我们</a></li>
			<li><a href="ProductServlet?reqName=toProductlist&pteid=1" name="show">案例展示</a></li>
			<li><a href="NewsServlet?reqName=tonews" name="new">新闻资讯</a></li>
			<li><a href="LxServlet?reqName=toContact" name="message">联系我们</a>
				<div class="secondary-menu">
					<ul>
						<li><a href="message.jsp" class="message"></a></li>
					</ul>
				</div>
			</li>
		</ul>
	</nav>
</div>
<!-- header end -->

	<div>
		<header class="header-article-list">
			<h1>在线留言</h1>

		</header>
		<div>
			<form class="message-form" method="post">
		    <c:if test="${not empty num }">
			<c:choose>
			<c:when test="${num gt 0 }">
			<span style="color: green">添加成功！</span>
			</c:when>
			<c:otherwise>
            <span style="color: red">添加失败！</span>
			</c:otherwise>
			</c:choose>
			</c:if> 
				<label>姓名 <input type="text" id="i1" name="userName"> <span>*</span>
				</label> <label>电话 <input type="text" id="i2" name="userPhone"> <span>*</span>
				</label> <label>邮箱 <input type="email" id="i3" name="userEmail"> <span>*</span>
				</label> <label>内容 <textarea name="userContent" id="i4" ></textarea> <span>*</span>
				</label>
				<button type="button" class="am-btn am-btn-danger" onclick="checkForm()">提交</button>
			</form>
		</div>
	</div>

	<script type="text/javascript">
	var layer, form, element;
	layui.use('element', function() {
		element = layui.element;
	});
	$(function() {
		layui.use([ 'layer' ], function() {
			layer = layui.layer;
		});
	});
	function checkForm() {
		var i1 = $("#i1").val();
		var i2 = $("#i2").val();
		var i3 = $("#i3").val();
		var i4 = $("#i4").val();//通过标记id去获得输入的数据
		if (i1 != "" && i2 != "" && i3 != "" && i4 != "") {
			window.location.href="LyServlet?reqName=addLy&i1="+i1+"&i2="+i2+"&i3="+i3+"&i4="+i4;
			/*  layer.msg('添加成功', {
				icon : 1,
				time : 1500
			});  */
			return true;
		} else {
			layer.msg('请填写完整', {
				icon : 2,
				time : 1500
			});
			return false;
		}
	}
	
	</script>
</body>
</html>